package io.renren.modules.store.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.store.dao.TStoreAccountListDao;
import io.renren.modules.store.entity.TStoreAccountListEntity;
import io.renren.modules.store.service.TStoreAccountListService;


@Service("tStoreAccountListService")
public class TStoreAccountListServiceImpl extends ServiceImpl<TStoreAccountListDao, TStoreAccountListEntity> implements TStoreAccountListService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TStoreAccountListEntity> page = this.page(
                new Query<TStoreAccountListEntity>().getPage(params),
                new QueryWrapper<TStoreAccountListEntity>()
                .eq("account_id",params.get("accountId"))
                .eq("status",1)
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage2(Map<String, Object> params) {
        IPage<TStoreAccountListEntity> page = this.page(
                new Query<TStoreAccountListEntity>().getPage(params),
                new QueryWrapper<TStoreAccountListEntity>()
                        .eq("account_id", params.get("accountUnitId"))
                        .eq("settlement_link", params.get("settlementLink"))
                        .eq("settlement_tel", params.get("settlementTel"))
                        .eq("settlement_time", params.get("time"))
        );

        return new PageUtils(page);
    }

}